<!doctype html>
<html lang="en">
<head>
<meta charset="utf-8">
<title>Timer closure</title>
<script>


function makeTimer(doneMessage, n) {

	setTimeout(function() {
		alert(doneMessage);
	}, n);

	doneMessage = "OUCH!";
}

makeTimer("Cookies are done!", 1000);



</script> 
</head> 
<body>
</body>
</html>

